
	<div id="graph<?php echo $reportdef['id']?>" style="text-align: center"></div>
	<script type="text/javascript">
		function refreshChart<?php echo $reportdef['id']?>(){
			document.getElementById('graph<?php echo $reportdef['id']?>').innerHTML = "<div \"style: text-align:center;\"><img style=\"width:66px;height:66px;\" alt=\"<?php echo __('wait please...'); ?>\" src=\"/images/ajax-loader-large.gif\"></div>";
			var $inputs = $(':input');
			var query = ''; 
			var first = true;
		    for(var i= 0; i < $inputs.length; i++)
		    {
		        if(first){
		            var symbol = '';
		        }else{
		        	var symbol = '&';
		        }
		        first = false;
		        if($inputs[i].name!=''){
		        	switch ($inputs[i].type) {
	        		case "checkbox":
		            var inputValue = $inputs[i].checked;
			        break;
		        		case "select-multiple":
			    		options = new Array();
			    		for(var j= 0; j < $inputs[i].options.length; j++){
							if($inputs[i].options[j].selected){
								options.push($inputs[i].options[j].value);
							}
			    		}
			    		var inputValue = array2json(options);
		        	break;
		        		default: 
					    var inputValue = $inputs[i].value;
				    }
			        
		    		query = query+symbol+$inputs[i].name+'='+inputValue;

		        }
		    };
		    RandomKey = Math.random(100);
			var URL = "<?php print url_for('reports/getData?id=' . $reportdef['id']); ?>" + "?format=chart&"+query + "&Seed=" + RandomKey;
			var xhrChart = getXmlHttpRequest2();
			xhrChart.onreadystatechange = function(){
				if(xhrChart.readyState == 4 && xhrChart.status == 200)
					{
					//var chartData = xhrChart.responseText;
					var chartData = "<center><img src='" + URL + "' alt=''/></center>";
					document.getElementById('graph<?php echo $reportdef['id']?>').innerHTML = chartData;
				}
			};
			xhrChart.open("POST",URL,true);
			xhrChart.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			xhrChart.send(null); // "id="+<?php echo $reportdef['id'];?>+ "&format=chart&"+query	
		}
	</script>